﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Entity;
using Command;
using System.Data.SqlClient;
namespace DAL
{
   public  class Z_Book
    {
       public static List<BookInformatica> GetBooks()
       {
           string sql = "";
           SqlDataReader sdr = DBHelper.Getdata(sql);
           List<BookInformatica> Books = new List<BookInformatica>();
           while(sdr.Read())
           {
               BookInformatica b = new BookInformatica();
               b.BookId = (int)sdr["BookId"];
               b.BookName = (string)sdr["BookName"];
               b.BookPress = (string)sdr["BookPress"];
               b.BookAuthor = (string)sdr["BookAuthor"];
               b.BookDescribe = (string)sdr["BookDescribe"];
               b.BookPicture = (string)sdr["BookPicture"];
               b.BookPoster = (string)sdr["BookPoster"];
               b.BookDetails = (string)sdr["BookDetails"];
               b.BookPrice = (float)sdr["BookPrice"];
               b.TypeID = (int)sdr["TypeID"];
               b.BookNumber = (string)sdr["BookNumber"];
               b.BookState = (int)sdr["BookState"];
               b.BookTime = (DateTime)sdr["BookTime"];
               Books.Add(b);
           }
           sdr.Close();
           return Books;
       }
    
    }
}
